import { defineStore  } from "pinia"
import axios from 'axios'
import { ref } from 'vue'
export const useChanelStore = defineStore('Chanel', () => {
    const count = ref(0)
    let lists = ref([])
    const getlist = async () => {
        const { data: { data } } = await axios.get('http://geek.itheima.net/v1_0/channels')
        lists.value = data.channels
    }
    const subcount = () => {
        count.value++
    }
    return { count, getlist, lists, subcount }
},
{
    persist: {
        key: 'mydata'
    }
}
)